package com.avcdata.controller;

import com.avcdata.dao.UserMapper;
import com.avcdata.core.Result;
import com.avcdata.validate.ValidateFiled;
import com.avcdata.validate.ValidateGroup;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class HelloController {
  @Autowired
  UserMapper userMapper;

  @ValidateGroup(fileds = {
      @ValidateFiled(index = 0, notNull = true, showName = "hello")
  })
  @RequestMapping(value = "/hello")
  public Result hello(String hello){
    return new Result<>(userMapper.selectAll(),hello,true);
  }

}
